﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="Cloud.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="/Javascript/ThirdParty/jquery-ui-1.8.14.custom/js/jquery-ui-1.8.14.custom.min.js" type="text/javascript"></script>
    <link href="/Javascript/ThirdParty/jquery-ui-1.8.14.custom/css/ui-lightness/jquery-ui-1.8.14.custom.css" rel="stylesheet" type="text/css" />
    <script src="/Javascript/ThirdParty/jquery.sound.js" type="text/javascript"></script>
    <script src="/Javascript/ThirdParty/jquery.timers.js" type="text/javascript"></script>
    <script src="/Javascript/ThirdParty/jquery.translate-1.4.7-debug-all.js" type="text/javascript"></script>
    <script src="/Javascript/Widgets/widget.all.js" type="text/javascript"></script>
    
    
    <style type="text/css">
        
        
        .column
        {
            width: 400px;
            float: left;
            padding-bottom: 100px;
        }
        .portlet
        {
            margin: 0 5px 5px 0;
        }
        .portletFullScr 
        {        	
        	width:100%;
        	height:100%;
        	position:absolute;
        	top: 0;
        	left: 0;
        }
        .portlet-id, .portlet-refresher, .portlet-settings
        {
        	display:none;
        	text-align:left;
        }
        .portlet-header
        {
        	font-family: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, Helvetica, Verdana, sans-serif;
        	font-size:12px;
            font-weight: normal;
            text-align: left;
            cursor: move;
            margin: 0.3em;            
            padding-bottom:3px;
            padding-top:2px;
            padding-left: 0.2em;
        }
        .portlet-header .ui-icon
        {
            float: right;
            cursor: pointer;
        }
        .portlet-content
        {
            padding: 0.4em;    
            max-height:200px;       
            overflow-y: scroll;
        }
        .ui-sortable-placeholder
        {
            border: 1px dotted black;
            visibility: visible !important;
            height: 50px !important;
            background-color:#FFF;
        }
        .ui-sortable-placeholder *
        {
            visibility: hidden;
        }
        
        .Transparent 
        {
        	-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
            filter: alpha(opacity=70);
            -moz-opacity:0.7;
            -khtml-opacity: 0.7;
            opacity: 0.7;
        }
        
        .Tweet 
        {
        	font-family: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, Helvetica, Verdana, sans-serif;
        	font-size:12px;
        	color:#000;
        	text-align:left;
        }
        .Tweet .PubDate 
        {
        	font-family: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, Helvetica, Verdana, sans-serif;
        	font-size:12px;
        	color:#006699;
        }
           
    </style>
    
    <script type="text/javascript">
        /* ASP.NET AJAX Impl. */
        $(function () {
            Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(CancelPostBack);
        });
        function CancelPostBack(sender, args) {
            if (Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()) {                
                args.set_cancel(true);
            }
        }
        function AbortTask() {
            var obj = Sys.WebForms.PageRequestManager.getInstance();
            if (obj.get_isInAsyncPostBack())
                obj.abortPostBack();
        }
        /* End of ASP.NET AJAX Impl. */

        $(function () {
            new Library.UserInterface.Widgets.RssReader({ container: $("#_portlet1"), feedSource: "http://feeds.reuters.com/Reuters/worldNews", onSettingsSave: "SaveRssReaderSettings" });
            new Library.UserInterface.Widgets.Weather({ container: $("#_portlet2"), country: "Denizli" });
            new Library.UserInterface.Widgets.Translate({ container: $("#_portlet3"), fromLang: "tr", toLang: "en" });
            new Library.UserInterface.Widgets.Currency({ container: $("#_portlet4") });
            new Library.UserInterface.Widgets.Calculator({ container: $("#_portlet5") });
            new Library.UserInterface.Widgets.Calendar({ container: $("#_portlet6") });

            InitPortlets(document.body);
        });

        function InitPortlets(ui) {
            $(".column").sortable({
                connectWith: ".column",
                handle: ".portlet-header",
                cursor: "move",
                disable: true,
                start: function (event, ui) { $(ui.item).addClass("Transparent"); },
                stop: function (event, ui) {
                    $(ui.item).removeClass("Transparent");
                }
            });

            if ($(ui).attr("id").indexOf("_portlet") > -1)
                ui = $(ui).parent("div");

            $(ui).find(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
			.find(".portlet-header")
				.addClass("ui-widget-header ui-corner-all")
				.end();

            /*
            if (!$(ui).find(".portlet").find(".portlet-header").find(".ui-icon")[0]) {
                $(ui).find(".portlet").find(".portlet-header").prepend("<span class='ui-icon ui-icon-minusthick TipTip' title='Daralt'></span>").end();
                $(ui).find(".portlet").find(".portlet-header").prepend("<span class='ui-icon ui-icon-wrench TipTip' title='Özelleştir'></span>").end();

                $(ui).find(".portlet").find(".portlet-header").find(".ui-icon-minusthick").bind('click', function () {
                    $(this).toggleClass("ui-icon-minusthick").toggleClass("ui-icon-plusthick");
                    $(this).parents(".portlet:first").find(".portlet-content").toggle("slow");
                });

                $(ui).find(".portlet").find(".portlet-header").find(".ui-icon-plusthick").bind('click', function () {
                    $(this).toggleClass("ui-icon-minusthick").toggleClass("ui-icon-plusthick");
                    $(this).parents(".portlet:first").find(".portlet-content").toggle("slow");
                });

                $(ui).find(".portlet").find(".portlet-header").find(".ui-icon-wrench").bind('click', function () {
                    ToggleSettings(this);
                }).end();
            }
            */
        }

        function ToggleSettings(ui) {
            $($(ui).parents(".portlet:first").find(".portlet-content").find(".portlet-widget")[0]).toggle('blind', {}, 500);
            $($(ui).parents(".portlet:first").find(".portlet-content").find(".portlet-settings")[0]).toggle('blind', {}, 500);
        }

        function SaveWeatherSettings(country) {
            Library.Ajax.WebMethod.Create("?Islem=SavePortletSettings&PortletType=PORTLET_WEATHER_COUNTRY&Setting=" + country);
        }

        function SaveRssReaderSettings(feedSource) {
            Library.Ajax.WebMethod.Create("?Islem=SavePortletSettings&PortletType=PORTLET_RSS_SOURCE&Setting=" + feedSource);
        }

        function SaveTranslateSettings(lang) {
            Library.Ajax.WebMethod.Create("?Islem=SavePortletSettings&PortletType=PORTLET_TRANSLATE&Setting=" + lang);
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="BodyContent" runat="server">    
    <div class="column">
        <div>
        <div class="portlet" id="_portlet1">
            <div class="portlet-header">
                <span class="portlet-title"></span>
            </div>
            <div class="portlet-content">
                <div class="portlet-widget"></div>
                <div class="portlet-settings"></div>
            </div>
        </div>
        </div>

        <div>
        <div class="portlet" id="_portlet6">
            <div class="portlet-header">
                <span class="portlet-title"></span>
            </div>
            <div class="portlet-content">
                <div class="portlet-widget"></div>
                <div class="portlet-settings"></div>
            </div>
        </div>
        </div>
    </div>
    <div class="column">
        <div>
        <div class="portlet" id="_portlet2">
            <div class="portlet-header">
                <span class="portlet-title"></span>
            </div>
            <div class="portlet-content">
                <div class="portlet-widget"></div>
                <div class="portlet-settings"></div>
            </div>
        </div>
        </div>

        <div>
        <div class="portlet" id="_portlet5">
            <div class="portlet-header">
                <span class="portlet-title"></span>
            </div>
            <div class="portlet-content">
                <div class="portlet-widget"></div>
                <div class="portlet-settings"></div>     
            </div>
        </div>
        </div>
    </div>
    <div class="column">
        <div>
        <div class="portlet" id="_portlet3">
            <div class="portlet-header">
                <span class="portlet-title"></span>
            </div>
            <div class="portlet-content">
                <div class="portlet-widget"></div>
                <div class="portlet-settings"></div>
            </div>
        </div>
        </div>

        <div>
        <div class="portlet" id="_portlet4">
            <div class="portlet-header">
                <span class="portlet-title"></span>
            </div>
            <div class="portlet-content">
                <div class="portlet-widget"></div>
                <div class="portlet-settings"></div>     
            </div>
        </div>
        </div>
    </div>

    <script type="text/javascript">
        $(".FormContainer").removeClass("FormContainer");
    </script>
</asp:Content>
